Skip to content

Conversation

tadeas-drab
Copy link

@tadeas-drab tadeas-drab commented Dec 16, 2023

Closes #2393

@tadeas-drab tadeas-drab marked this pull request as ready for review December 16, 2023 21:53
@JRoy JRoy changed the title Feature/2393 multiple home per world Per-World Home Limits Oct 5, 2025
Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, sorry this got lost in the queue. i requested a few changes and think we can simplify the approach to the config. after my review is addressed i will try to get this merged in asap.

throw new TranslatableException("noPerm", "essentials.worlds." + loc.getWorld().getName());
}
if(!isUserHomeInWorldOrWorldGroupWorld(user.getWorld().getName(), Objects.requireNonNull(loc.getWorld()).getName())) {
throw new Exception(tl("teleportNotPossible"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use TranslatableException here:

throw new TranslatableException("teleportNotPossible");

Comment on lines +833 to +859
# When home-limit-per-world is enabled, with configuration sethome-multiple whichever setting has a number higher,
# it then will be used
# e.g. if sethome-multiple.vip is 5 and user has permission for this, and user is in world named world_the_end which
# limit for home is 2, then user will have limit of higher number, therefore 5 homes in that world.
# To not follow this logic, please remove user permission for that 'home rank'.
# If world is not present in this configuration, configuration sethome-multiple.default
# will be used as a home limit for that world.
homes-per-world:
world: 5
world_the_end: 2

# For this configuration, previous configuration home-limit-per-world needs to be enabled.
# This allows you to create 'world groups' which can consist of how many worlds you want
# and set limit for these worlds, then they will act as one world with their limit.
# e.g. 'world group' named player-worlds which has worlds 'world' and 'world_nether'
# which home limit is set to 4. User will have maximum of 4 homes in these worlds total.
# If world is not present in this configuration, configuration sethome-multiple.default
# will be used as a home limit for that world.
home-limit-per-world-group: false

# Name of the world group can be any english letter with spaces that are -
# Worlds are split by a colon without spaces, as shown in the example: world,world_nether .
# Worlds in a 'world group' act as one world.
homes-per-world-group:
player-worlds:
worlds: world,world_nether
home-limit: 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think these config options should instead be:

home-limit-per-world: false

sethome-world-multiple:
  default:
    world: 5
    world_the_nether: 10
  vip:
    world: 10
    world_the_nether: 20

this way we can minimize confusion and let people configure it all under one setting, people who don't want to do by group can just use default

final int limit = ess.getSettings().getHomeLimit(user);
if (usersHome.getHomes().size() >= limit) {
final List<String> homes = usersHome.isReachable() ?
usersHome.getHomesPerWorld(Objects.requireNonNull(usersHome.getLocation().getWorld()).getName())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we get the limit for user not usersHome`?

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, sorry this got lost in the queue. i requested a few changes and think we can simplify the approach to the config. after my review is addressed i will try to get this merged in asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple homes on a per world basis

2 participants